<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>奇偶交错背景 CSS</title>
    <style>
      main {
        width: 100%;
      }
      pre {
        width: 100%;
        display: inline-flex;
        background: #f8f8f8;
        background-image: linear-gradient(
          rgba(18, 18, 18, 0.05) 50%,
          transparent 0
        );
        background-size: auto 48px;
        background-origin: content-box;
        font: 14px/24px Consolas, Monaco, monospace;
      }
      main pre > code {
        display: inline-block;
        padding: 0;
        color: #34495e;
        background-color: transparent;
        font: inherit;
      }
    </style>
  </head>
  <body>
    <main class="main">
      <pre>
      <code class="language-js">
        const pull = (arr, ...args) => {
          let argState = Array.isArray(args[0]) ? args[0] : args;
          let pulled = arr.filter((v, i) => !argState.includes(v));
          arr.length = 0;
          pulled.forEach(v => arr.push(v));
        };
        let myArray = ['a', 'b', 'c', 'a', 'b', 'c'];
        pull(myArray, 'a', 'c');
        console.log(myArray);
      </code>
    </pre>
    </main>
  </body>
</html>
